require(quanteda)
require(LSX)
require(gplots)

toks <- readRDS("data/tokens_en.rds")
lss <- readRDS("lss_en3.rds")

dfmt <- dfm(toks)
dat <- docvars(dfmt)
dat$lss <- predict(lss, dfmt, min_n = 10)
dat$lss_bin <- cut(dat$lss, c(-Inf, -3:3, Inf))

saveRDS(dat, "data_predict_en.rds")
